import superRequest from '@/utils/http/index'
import { IDataType } from '@/utils/http/types'

/** 定时任务列表(接口) */
export const apiJobList = async (data: any) => {
  return await superRequest.post<IDataType>({
    url: '/job/list',
    data,
  })
}

/** 定时任务新增(接口) */
export const apiJobAdd = async (data: any) => {
  return await superRequest.post<IDataType>({
    url: '/job/add',
    data,
  })
}

/** 定时任务修改(接口) */
export const apiJobUpdate = async (data: any) => {
  return await superRequest.post<IDataType>({
    url: '/job/update',
    data,
  })
}

/** 定时任务删除(接口) */
export const apiJobDelete = async (data: any) => {
  return await superRequest.post<IDataType>({
    url: '/job/delete',
    data,
  })
}

/** 开始任务(接口) */
export const apiStartJob = async (data: any) => {
  return await superRequest.post<IDataType>({
    url: '/job/start',
    data,
  })
}

/** 停止任务(接口) */
export const apiStopJob = async (data: any) => {
  return await superRequest.post<IDataType>({
    url: '/job/stop',
    data,
  })
}
